<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script>
        function times() {
            let today = new Date();
            let times = today.toLocaleString();
            return times;
        }
        console.log(times());
        function showTime() {
            var today = new Date();
            var year = today.getFullYear();
            var month = today.getMonth();
            var date = today.getDate();
            var hours = today.getHours();
            var miniutes = today.getMinutes();
            var seconds = today.getSeconds();
            var day = today.getDay();
            var weeks = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
            return year + "年" + (month + 1) + "月" + date + "日" + " " + hours + ":" + miniutes + ":" + seconds + " " + weeks[day];
        }
        console.log(showTime());
    </script>
</head>

<body>

</body>

</html>